import ttkbootstrap as ttk
from ttkbootstrap.constants import *
from rely.defmath import *
root = ttk.Window(title="计算器",
                  themename="litera",
                  size=(640, 340),
                  position=(100, 100),
                  minsize=(0, 0),
                  maxsize=(1920, 1080),
                  resizable=None,
                  alpha=1.0, )
var = ttk.StringVar()
ttk.Label(root, text="x:", bootstyle=INFO, font=("楷体", 20)).place(x=10, y=10)
ttk.Label(root, text="y:", bootstyle=INFO, font=("楷体", 20)).place(x=10, y=60)
x1 =ttk.Entry(root, show=None, width=45, bootstyle=PRIMARY)
y1 =ttk.Entry(root, show=None, width=45, bootstyle=PRIMARY)
x1.place(x=50, y=13)
y1.place(x=50, y=63)
text= ttk.Text(root,width=300,height=2)
text.place(x=10,y=109)
ttk.Button(root,text="加", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :jia(x1,y1,text),width=7).place(x=15,y=170)
ttk.Button(root,text="减", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :jian(x1,y1,text),width=7).place(x=115,y=170)
ttk.Button(root,text="乘", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :cheng(x1,y1,text),width=7).place(x=215,y=170)
ttk.Button(root,text="除", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :chu(x1,y1,text),width=7).place(x=315,y=170)
ttk.Button(root,text="除法取整", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :chuqz(x1,y1,text),width=7).place(x=415,y=170)
ttk.Button(root,text="除法取余", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :chuqu(x1,y1,text),width=7).place(x=515,y=170)
ttk.Button(root,text="x的y次方", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rpow(x1,y1,text),width=7).place(x=15,y=220)
ttk.Button(root,text="x平方根", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rsqrt(x1,text),width=7).place(x=115,y=220)
ttk.Button(root,text="x绝对值", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rfabs(x1,text),width=7).place(x=215,y=220)
ttk.Button(root,text="x的阶乘", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rfactorial(x1,text),width=7).place(x=315,y=220)
ttk.Button(root,text="x的取模", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rfmod(x1,y1,text),width=7).place(x=415,y=220)
ttk.Button(root,text='xy最大公约数', bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rgcd(x1,y1,text),width=9.5).place(x=515,y=220)
ttk.Button(root,text="x的正弦", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rsin(x1,text),width=7).place(x=15,y=270)
ttk.Button(root,text="x的余弦", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rcos(x1,text),width=7).place(x=115,y=270)
ttk.Button(root,text="x的正切", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rtan(x1,text),width=7).place(x=215,y=270)
ttk.Button(root,text="x反正弦", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :rasin(x1,text),width=7).place(x=315,y=270)
ttk.Button(root,text="x反余弦", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :racos(x1,text),width=7).place(x=415,y=270)
ttk.Button(root,text="x反正切", bootstyle=(PRIMARY, "outline-toolbutton"),command=lambda :ratan(x1,text),width=7).place(x=515,y=270)
root.mainloop()